import { SysOrder } from "../../GameDef";
import { IECSFilter } from "../../lib/kgame/ecs/ECSFilter";
import { ECSSys } from "../../lib/kgame/ecs/ECSSys";
import { AICmp } from "../cmp/AICmp";

export class AISys extends ECSSys {

    get updateOrder(): number {
        return SysOrder.ai;
    }

    get ifilter(): IECSFilter {
        return { includeOne: [AICmp] };
    }

    onLateUpdate(): void {
        this.getCmps(AICmp).forEach(ai => {
            ai.ai.update(this.scene.dt);
        });
    }

}